#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
  int maximumDifference(vector<int> &nums)
  {
    int ans = -1;
    int left = nums[0];
    int div;
    for (int i = 1; i < nums.size(); i++)
    {
      div = nums[i] - left;
      if (div > 0)
        ans = max(ans, div);
      left = min(left, nums[i]);
    }
    return ans;
  }
};
int main()
{
  Solution s;

  return 0;
}
